"""
@author: 江同学呀
@file: base.py
@date: 2023/8/22 19:45
@desc:
"""


import datetime
import inspect
import sys
from typing import Generator, Type, Any, Union, Dict

CLASS_STATUS: int = 0
OBJECT_STATUS: int = 1


class _Base(object):
    """
    基类
    """
    __abstract__ = True
    _status: int = CLASS_STATUS
    _init_finished: bool = False

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._status: int = OBJECT_STATUS
        return

    def _get_custom_attrs(self: Union["_Base", Type["_Base"]]) -> Generator[str, None, None]:
        """
        获取自定义属性
        :return:
        """
        return (attr for attr in dir(self) if not attr.startswith("__"))

    def _build(self) -> Dict:
        """
        构建
        :return:
        """
        raise NotImplementedError("基类未实现构建方法。")

    def _to_dict(self) -> Dict:
        raise NotImplementedError("基类未实现JSON序列化方法。")


